package com.zrrd.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


@Schema(name = "UserLoginDTO", description = "用户登录DTO实体类")
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties("handler")
public class UserLoginDTO implements Serializable {

    @Schema(description = "登录账号", required = true, example = "zhaosi")
    @NotEmpty(message = "登录业务中账号不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]{3,20}$", message = "登录账号必须由3-20位的数字，字母，下划线或横线组成")
    private String username;

    @Schema(description = "登录密码", required = true, example = "zhaosi")
    @NotEmpty(message = "登录业务中密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]{3,20}$", message = "登录密码必须由3-20位的数字，字母，下划线或横线组成")
    private String password;
}
